package cn.tedu.lucky.draw.user.config;

import cn.tedu.lucky.draw.user.handler.UserLogHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;

@Configuration
public class UserLogRouter {

    /**
     * 路由配置
     * RouterFunction: 路由函数,用于定义路由规则
     */
    @Bean
    public RouterFunction<ServerResponse> routeUserLog(UserLogHandler userLogHandler){
        return route(GET("/draw/user-log/findAll"),userLogHandler::findAll);
    }
}
